import axios from "../utils/axios";

export default {
  get() {
    return axios.get(`/api/cart`);
  },
  add(id, num) {
    return axios.post("/api/cart", {
      data: {
        bid: id,
        count: num
      }
    });
  },
  drop(id) {
    return axios.delete("/api/cart", {
      data: {
        bid: id
      }
    });
  },
  update(id, count) {
    return axios.post("/api/cart/" + id, {
      data: {
        count
      }
    });
  }
};
